﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TCL.FUNC;

namespace TCL.EO
{
    [Serializable()]
    public class ConnectionStringEO
    {
        public String name { get; set; }
        public String connectionString { get; set; }
        public String providerName { get; set; }

        public ConnectionStringEO(String _name, String _connectionString, String _providerName)
        {
            this.name = _name;
            if (SystemEx.getAppSettings("NMT_isSCS").Equals("1"))
                this.connectionString = SecurityEx.DecryptString(_connectionString, SecurityEx.Base64Encode(Environment.MachineName + _providerName + Environment.UserName));
            else
                this.connectionString = _connectionString;
            this.providerName = _providerName;
        }

        public ConnectionStringEO()
        {
        }
    }

    //public enum ProviderName
    //{
    //    MSSql = "System.Data.SqlClient",
    //    SQLite = "",
    //    Oracle = "System.Data.OracleClient",
    //    MSAccess = "Microsoft.ACE.OLEDB.12.0",
    //    MSAccess = "Microsoft.Jet.OLEDB.4.0",
    //    MySql = "",
    //}
}
